<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
  <p>{{date}}</p>
</div>
<script>
  Vue.createApp({
    data(){
      return {
        date:'00:00:00'
      }
    },
    mounted(){ //mounted()⽣命周期：DOM挂载后
      setInterval(()=>{
        let d = new Date();
        this.date = d.getHours()+':'+d.getMinutes()+':'+d.getS
        econds();
      },1000);
    }
  }).mount("#app")
</script>

</body>
</html>